<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<sx:head />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css" href="css/master.css">
		<title>
	Promotion
<s:include value="/include/header/mainNav.jsp"></s:include>
	<!--NAV ENDS HERE-->
    <!--DISPLAY STARTS HERE-->
    <div id="display">
    <!--DISPLAY INNER STARTS HERE-->
	<div id="display-inner">
		<h1>Promotion</h1>
		<table>
			<tr>
				<td class="table-width">Option</td>
				<td class="table-width">ID</td>
				<td class="table-width">Name</td>
				<td class="table-width">Description</td>
				<td class="table-width">Duration</td>
				<td class="table-width">Start Date</td>
				<td class="table-width">End Date</td>
				<td class="table-width">Offerings</td>
			</tr>
			<s:iterator value="promotions" var="pro">
				<tr>
					<td class="table-width">
						<a href="promotion.action?promotionId=<s:property value='#pro.id'/>">
							Edit
						</a>
					</td>
					<td class="table-width"><s:property value="#pro.id" /></td>
					<td class="table-width"><s:property value="#pro.name" /></td>
					<td class="table-width"><s:property value="#pro.description" /></td>
					<td class="table-width"><s:property value="#pro.duration" /></td>
					<td class="table-width"><s:property value="#pro.startDate" /></td>
					<td class="table-width"><s:property value="#pro.endDate" /></td>
					<td class="table-width">
						<a href="promoOffering.action?promotionId=<s:property value='#pro.id'/>">
							Manage Offerings
						</a>
					</td>
				</tr>
			</s:iterator>

		</table>

		<form action="promotion" >
			<p class="paragraph-form">
				<s:textfield name="promotion.name" label="Name" cssClass ="input-field" />
			</p>
			<p class="paragraph-form">
				<s:textfield name="promotion.description" label="Description" cssClass ="input-field" />
			</p>
			<p class="paragraph-form">
				<s:textfield name="promotion.duration" label="Duration" cssClass ="input-field" />
			</p>
			<div class="calendar">
				<sx:datetimepicker name="promotion.startDate" value="%{promotion.startDate}" label="StartDate" displayFormat="yyyy-MM-dd" cssClass ="input-field" />
				<sx:datetimepicker name="promotion.endDate" value="%{promotion.endDate}" label="EndDate" displayFormat="yyyy-MM-dd" cssClass ="input-field" />
			</div>
			<p>
				<s:hidden name="promotion.id" />
				<s:submit value="Create" id="submit-button-2" />
			</p>
			<br>
		</form>

		<s:include value="/include/footer/footer.jsp"></s:include>		
